#pragma once

#include <Game/Entity.h>
#include <Totem/Component.h>
#include <Totem/PropertyList.h>

namespace Game
{
	namespace World
	{
		namespace Systems { class ZoneSystem; class RoomSystem; }
		namespace Components
		{
			class Zone : public Totem::Component
			{
			public:
				COMPONENT_1(Entity, Zone, Systems::ZoneSystem);

				Zone(Entity &owner, const T_String &type, Systems::ZoneSystem &zoneSystem);
				virtual ~Zone();
				
				virtual void update(const F32 &dt);

				Systems::ZoneSystem &getSystem() { return zoneSystem; }
				Systems::RoomSystem &getRoomSystem() { return *roomSystem; }

			private:
				Systems::ZoneSystem &zoneSystem;
				Systems::RoomSystem *roomSystem;

				//EVENTS
				T_HashedString enterEventId;
				T_HashedString leaveEventId;

				void onEnter(Entity &entity, const U32 &direction);
				void onLeave(Entity &entity, const U32 &direction);
			};
		}
	}
}
